package com.higgins.server;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import com.higgins.client.dataModel.CoveringLetterDTO;
import com.higgins.client.dataModel.SectorDTO;
import com.higgins.client.dataModel.StrategyDTO;

@Entity
@Table(name = "sectors")
public class Sector {
    private Long id;
    private String name;

    public Sector() {
        // This is used by JPA
    } 

    @Id
    @GeneratedValue(generator = "increment")
    @GenericGenerator(name = "increment", strategy = "increment")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public SectorDTO toDTO()	{
    	SectorDTO dto = new SectorDTO();
    	dto.setId(id);
    	dto.setName(name);
    	return dto;
    }
    public void update(SectorDTO dto)	{
    	this.name = dto.getName();
    }
}